package sctu.edu.java.year2016.team01.xuhanmei.day20160601.chapter10_2;

import java.util.*;

/**
 * Created by Administrator on 2016/6/1.。。
 * 分别向set集合和list集合中添加"A","a","c","C","a"五个元素，观察重复值a能否在list集合和set集合中成功添加
 */
public class ComLandS {
    public static void main(String[] args) {
        String a = "A", b = "a", c = "c", d = "C", e = "a";
        List<String> list = new ArrayList<>();//创建list集合
        list.add(a);
        list.add(b);
        list.add(c);
        list.add(d);
        list.add(e);
        System.out.println(list);
        Set<String> set = new HashSet<>();//创建set集合
        set.add(a);
        set.add(b);
        set.add(c);
        set.add(d);
        set.add(e);
        System.out.println(set);

    }
}
